<?php
/**
 * +----------------------------------------------------------------------
 * | 会员管理模型
 */
namespace app\model;

// 引入框架内置类
use think\facade\Db;
use think\model;

class MovieDetail extends Model
{
    // 定义时间戳字段名
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';
    protected $table = 'movie_detail';

    public static function getListByType($type,$offset = 0,$limit = 5){
        $sql = "select * from movie_detail WHERE  find_in_set({$type},type) limit {$offset},{$limit}";
        $res = Db::query($sql);
        return $res;
    }

    public static function getListByClass($class){
        $sql = "select * from movie_detail WHERE  find_in_set({$class},class_id)";
        $res = Db::query($sql);
        return $res;
    }

    public static function getListByMid($movie_id,$field = '*'){
        $res = self::where('movie_id',$movie_id)->field($field)->find();
        return $res;
    }

}
